package md.mru.core.domains.type;

/**
 * @author sergiu.marin
 * @since 24.05.2014.
 */
public enum NodeType {
    READ_ONLY(null),
    STATIC_FOLDER(null),
    ATTACHED_PERSON(null),
    POSITION("ui-icon-person"),
    FOLDER("ui-icon-folder-collapsed"),
    FOLDER_OFFICE("ui-icon-folder-collapsed"),      //ui-icon-folder-office
    FOLDER_DEPARTMENT("ui-icon-folder-collapsed"),  //ui-icon-folder-department
    FOLDER_SECTION("ui-icon-folder-collapsed"),     //ui-icon-folder-section
    FOLDER_POST("ui-icon-folder-collapsed");        //ui-icon-folder-post

    private final String icon;

    NodeType(String icon) {
        this.icon = icon;
    }

    public String getIcon() {
        return icon;
    }

    public static NodeType valueOfByIcon(String value) {
        for (NodeType f : NodeType.values()) {
            if (value != null && f.icon.equals(value)) {
                return f;
            }
        }
        return null;
    }

}
